# Maintainer: Antonio Rojas <arojas@archlinux.org>

pkgname=lidia
pkgver=2.3.0
_patchver=2019-05-02
pkgrel=4
pkgdesc="A library for computational number theory"
arch=(loong64 x86_64)
url="https://www.math.ucdavis.edu/~latte/"
license=(GPL)
depends=(gmp)
source=("https://github.com/mkoeppe/LiDIA/releases/download/v$pkgver%2Blatte-patches-$_patchver/lidia-$pkgver+latte-patches-$_patchver.tar.gz")
sha256sums=('a5a07e65fc48c9230e9669e4d968b4ede2cac234a49d0c8c93b85040d0d79c41')

build() {
  cd lidia-$pkgver+latte-patches-$_patchver

  export CXXFLAGS="-DNTL_STD_CXX $CXXFLAGS"
  ./configure --prefix=/usr --enable-shared
  make
}

package() {
  cd lidia-$pkgver+latte-patches-$_patchver
  make DESTDIR="$pkgdir" install

# Fix capitalization (needed by latte-integrale)
  mv "$pkgdir"/usr/include/{lidia,LiDIA}
}

